import { U } from '../../lib/backend'
import axios from 'axios'
import env from '../../config/common'

export default {
  // 获取sms
  getTransformList ({ dispatch, commit, state, rootState }, info) {
    const URL =
      env.CRM_API_HOST +
      '/admin/' +
      rootState.auth.user.token +
      '/sites/' +
      rootState.auth.site_id +
      '/transform/list'
    // const URL = 'http://rap2api.taobao.org/app/mock/2717/GET/admin/[token]/sites/[site_id]/transform/list'
    return axios.get(URL + '?' + U(info))
  },
  getTeamTransformList ({ dispatch, commit, state, rootState }, info) {
    const URL =
      env.CRM_API_HOST +
      '/admin/' +
      rootState.auth.user.token +
      '/sites/' +
      rootState.auth.site_id +
      '/team/transform'
    // const URL = 'http://rap2api.taobao.org/app/mock/2717/GET/admin/[token]/sites/[site_id]/team/transform'
    return axios.get(URL + '?' + U(info))
  },
  getMemberTransformList ({ dispatch, commit, state, rootState }, info) {
    const URL =
      env.CRM_API_HOST +
      '/admin/' +
      rootState.auth.user.token +
      '/sites/' +
      rootState.auth.site_id +
      '/suid/transform'
    // const URL = 'http://rap2api.taobao.org/app/mock/2717/GET/admin/[token]/sites/[site_id]/suid/transform'
    return axios.get(URL + '?' + U(info))
  }
}
